﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Collections;

/// <summary>
/// Summary description for XL_KH
/// </summary>
public class XL_XX
{
    protected DataRow Dong;
    protected static String Tenbang = "XUAT_XU";

    public string MaXX
    {
        get
        {
            return this.Dong["MXX"].ToString();
        }
        set
        {
            this.Dong["MXX"] = value;
        }
    }

    
    public String Tennuoc
    {
        get
        {
            return this.Dong["Tennuoc"].ToString();
        }
        set
        {
            this.Dong["Tennuoc"] = value;
        }
    }

	
     public XL_XX()
    {
        String sql="select * from " + Tenbang;
        DataTable Bang  = DataProvider.ExecuteStructureQuery(sql);
        Dong = Bang.NewRow();
        Bang.Rows.Add(Dong);
    }

    public XL_XX(DataRow DongN)
	{
		//
		// TODO: Add constructor logic here
		//
        this.Dong = DongN;
	}

    public static ArrayList Doc_danh_sach()
    {
        ArrayList Kq = new ArrayList();
        string sql = "Select * ";
        sql += " From " + Tenbang;
        
        DataTable Bang = DataProvider.ExecuteQuery(sql);
        foreach (DataRow DT in Bang.Rows)
        {
            XL_XX LTK = new XL_XX(DT);
            Kq.Add(LTK);
        }
        return Kq;

    }
     

    public void Ghi() // Ghi tung dong
    {
    
        //Ghi Bang
        
        DataProvider.Save(this.Dong, Tenbang);

    }
    public void Xoa()
    {

       
        DataProvider.Delete(this.Dong, Tenbang);

    }

}

  